package com.bbh.plugin.single.privilege.core.service;

import com.bbh.plugin.single.privilege.core.entity.Employee;
import com.bbh.plugin.single.privilege.core.repository.EmployeeMapper;
import com.bbh.plugin.single.privilege.core.vo.EmployeeVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import com.bbh.common.domain.Page;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;
import com.bbh.common.base.service.BaseService;
@Service
@Transactional
public class EmployeeService extends BaseService<Employee, String> {
    @Autowired
    private EmployeeMapper employeeMapper;


     /*
      *
      * 分页查询
      * */

    public Page<EmployeeVo> selectPageList(Map<String, Object> params, Page pageable) {
        PageHelper.startPage(pageable.getPageNum() + 1, pageable.getPageSize());
        List<EmployeeVo> userVoList = employeeMapper.findPageList(params);
        PageInfo<EmployeeVo> pageInfo = new PageInfo<>(userVoList);
        return pageConverter(pageInfo);
    }



}
